package com.aiit.controller;

import com.aiit.pojo.Resume;
import com.aiit.service.ResumeService;
import com.aiit.util.TableResult;
import com.aiit.vo.PageResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: LuTao
 * @Date: 2022/05/09/11:06
 */
@Controller
public class ResumeController {
    @Autowired
    private ResumeService resumeService;
    @ResponseBody
    @GetMapping("/resume/getByCondition")
    public TableResult<Resume> getByCondition(@RequestParam("page")Long page, @RequestParam("limit")Long limit,
                                              @RequestParam("username")String username){
        PageResultVo<Resume> pageResultVo = resumeService.getByCondition(page,limit,username);
        return new TableResult(0,"",pageResultVo.getTotal(),pageResultVo.getRecords());
    }
}
